/**
 * @author MIAO
 * Created on 2011-11-7
 * For more information, please visit:ismiao.com
 */
package com.ismiao.knowledge;

public class Equals {
	public static void main(String[] args) {
		String s1 = "aa";
		String s2 = "aa";
		String s3 = "a";
		String s4 = s3 + "a";
		System.out.println(s1 == s2);
		System.out.println("s1.hashCode()==s2.hashCode(): "
				+ (s1.hashCode() == s2.hashCode()));
		System.out.println(s1.equals(s2));
		System.out.println(s4.equals(s2));
		System.out.println("s1.hashCode()==s4.hashCode(): "
				+ (s1.hashCode() == s4.hashCode()));
		System.out.println(s1 == s4);
		ass(s1);
		System.out.println(s1 == s2);

	}

	public static void ass(String b) {
		b = new String("aa");
	}
}
